<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.wxtf.platform.plugins.user.*"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	UserBean user = (UserBean)request.getSession().getAttribute("userBean");
	String _db = user.getDbType();	
	   
	    Map<String,List<Map<String, String>>> dicMap = user.getDicMap();
	    List<Map<String, String>> list = null;
	    String temp = "";	
	    String tbe_marital_status = "";//婚姻状态
	    String tbe_nation = "";//民族
	    
	    list = null;
	    list = dicMap.get("27");
	    if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_marital_status += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	    }
	    list = null;
	    list = dicMap.get("5");
	    if(null != list && list.size() > 0){
		for(Map<String, String> map: list){
			tbe_nation += "<option value=\"" + map.get("tmgd_id")+"\">" + map.get("tmgd_name") + "</option>";
		}
	    }
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>"/>
		<title>已婚育龄员工名单</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

		<link type="text/css" rel="stylesheet" href="ligerUI/skins/Aqua/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/<%=user.getUserCss()%>/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/ligerui-icons.css" />
		<link type="text/css" rel="stylesheet" href="resource/css/style.css" />

		<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="ligerUI/js/core/base.js"></script>
		<script type="text/javascript" src="ligerUI/js/ligerui.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<script type="text/javascript" src="js/validata.js"></script>

		<script type="text/javascript" src="ligerUI/js/plugins/ligerGrid.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerTree.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerForm.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerDateEditor.js"></script>
		
		<script type="text/javascript" src="ligerUI/jquery-validation/jquery.validate.min.js" ></script> 
		<script type="text/javascript" src="ligerUI/jquery-validation/jquery.metadata.js"></script>
		<script type="text/javascript" src="ligerUI/jquery-validation/messages_cn.js" ></script>
		
<script type="text/javascript">
var _db = '<%=_db%>';

_jsonObj.classname = "com.wxtf.platform.main.proprietaryInquires.Married";
_jsonObj.methodname = "";
_jsonObj.logicdata = '';

var manager;//人员表格
$(function(){
	manager = $("#emp-grid").ligerGrid({
		url: _url, parms: _jsonObj, width: '100%', height: '100%',
		usePager: true, rownumbers: true, checkbox: false, alternatingRow: true,
		columns: [
			{ display: '机构', name: 'reserve1',id:'reserve1',width:100 ,isSort:false},
			{ display: '主键', name: 'tbe_id',id:'tbe_id', hide: true,width:1 },
			{ display: 'org_id', name: 'org_id',id:'org_id', hide: true,width:1 },
			{ display: '姓名', name: 'tbe_name',id:'tbe_name',width:100 },
			{ display: '身份证号', name: 'tbe_idcard',id:'tbe_idcard',width:180 },
			{ display: '性别', name: 'tbe_sex',id:'tbe_sex', width:50 },
			{ display: '出生日期', name: 'tbe_birthday',id:'tbe_birthday',width:100},
			{ display: '职级', name: 'tbe_position',id:'tbe_position', width:100,
			      render: function(record, index, value, oth){
			         if(record.tbe_position =='1')  {return "专业技术管理";}
			         if(record.tbe_position =='2')  {return "生产操作服务";}
 			      }
			 },
			{ display: '婚姻状态', name: 'tbe_marital_status',id:'tbe_marital_status',width:100,
			       render: function(record, index, value, oth){
						 <%
						list = dicMap.get("27");
						temp = "";
						if(null != list && list.size() > 0){
							for(Map<String, String> map: list){
						%>
						if(value == '<%=map.get("tmgd_id")%>'){
							<%
							temp = map.get("tmgd_name");
							%>
							return '<%=temp%>';
						}
						<%
							}
						}
						%>
						 return value;
					}
			 },
			{ display: '子女情况', name: 'tbe_children_status',id:'tbe_children_status',width:1, hide: true }

		]
	});

	/*
	 * 日期框
	 */
	$("#ser_from").ligerDateEditor({ format: "yyyy-MM-dd", width:182 });
	$("#ser_to").ligerDateEditor({ format: "yyyy-MM-dd", width:182});
});

/*
 * 表格刷新
 */
function reload(){
	_jsonObj.methodname = "queryPage";
	_jsonObj.logicdata = '[{\"type\":\"init\",\"sex\":\"\"}]';
	manager.loadData();
}


/*
 * 重置-条件查询
 */
function serReset(){
	$('#ser_from').val('');
	$('#ser_to').val('');
	// $('#ser_org').val('');
	$('#ser_sex').val('');
}

/*
 * 条件查询
 */
function serch1(){
	var ser_from = $('#ser_from').val();
	var ser_to = $('#ser_to').val();
    var ser_org = $('#ser_org').val();
    var ser_sex = $('#ser_sex').val();
	_jsonObj.methodname = "queryPage";
	_jsonObj.logicdata = '[{\"ser_from\":\"' + ser_from	+ '\",\"ser_to\":\"' + ser_to+ '\",\"ser_org\":\"' + ser_org+ '\",\"sex\":\"' + ser_sex+ '\",\"type\":\"tj_ser\"}]';
	manager.loadData();
}

/*
 * 时间验证
 */
function joinTime(ele){
	var ser_from = $('#ser_from').val();
	var ser_to = $('#ser_to').val();
	if('' != ser_from && '' != ser_to){
		var res = compareDate(ser_from, ser_to);
		if(null == res || res >= 0){
			ele.value = '';
			warningTip('时间有误！');
			return;
		}
	}
}

</script>
</head>
	<body>
	 

        <div tabid="home1" style="height:300px" >
		<table id="aaa" class="serTable">
			<tr>
				<td>机构：</td>
				<td>
					<select id="ser_org" style=" width: 160px;">
						<%=user.getCurSubOrgOptions()%>
					</select>
				</td>
				<td>出生日期：</td>
				<td><input id="ser_from" onChange='joinTime(this);' onkeyup="this.value=formatdata(this.value);"/></td>
				<td><input class="btn2" value="重置" type="button" onclick="serReset();" /></td>
                </tr>
                <tr>
				<td>性别：</td>
				<td>
				   <select id="ser_sex" name="ser_sex" style=" width: 160px;"> 
				  			<option value="">-请选择-</option>
				 			<option value="男">男</option>
				 			<option value="女">女</option>
							</select>
                </td>
				<td>--</td>
				<td><input id="ser_to" onChange='joinTime(this);' onkeyup="this.value=formatdata(this.value);"/></td>
				<td><input class="btn2" value="搜索" type="button" onclick="serch1();" /></td>
			</tr>
		</table>
		
		<div id="emp-grid"></div>
		</div>
		
	</body>
</html>